﻿
<div>
    <form name="basicPersonCreateOrEditForm" role="form" novalidate class="form-validation">
        <div class="modal-header">
            <h4 class="modal-title">
                <span ng-if="vm.basicPerson.id">编辑信息:{{vm.basicPerson.name}}</span>
                <span ng-if="!vm.basicPerson.id">新增信息</span>
            </h4>
        </div>
        <div class="modal-body">

            <div class="form-group form-md-line-input form-md-floating-label no-hint" ng-show="false">
                <input type="text" class="form-control" name="ParentID" ng-class="{'edited':vm.basicPerson.parentID}" ng-model="vm.basicPerson.parentID" maxlength="50" required />
                <label>是否业主</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Name" ng-class="{'edited':vm.basicPerson.name}" ng-model="vm.basicPerson.name" maxlength="50" required />
                <label>@L("Name")</label>
                <span class="help-block">     @L("Name")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="Sex" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.basicPerson.sex">
                    <option ng-repeat="x in vm.sexList" value="{{x.value}}" ng-selected="vm.basicPerson.sex==x.value">{{x.name}}</option>
                </select>
                <label>@L("Sex")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="IdCard" ng-class="{'edited':vm.basicPerson.idCard}" ng-model="vm.basicPerson.idCard" maxlength="18" required ng-pattern="/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/" />
                <label>@L("IDCard")</label>
                <span class="help-block" ng-show="basicPersonCreateOrEditForm.IdCard.$error.required">     @L("IDCard")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!basicPersonCreateOrEditForm.IdCard.$error.required&&basicPersonCreateOrEditForm.IdCard.$invalid">     @L("PleaseEnterTheCorrectType")@L("IDCard")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="number" class="form-control" name="TotalPopulation" ng-class="{'edited':vm.basicPerson.totalPopulation}" ng-model="vm.basicPerson.totalPopulation" />
                <label>@L("TotalPopulation")</label>
                <span class="help-block">     @L("TotalPopulation")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Relationship" ng-class="{'edited':vm.basicPerson.relationship}" ng-model="vm.basicPerson.relationship" maxlength="50" required />
                <label>@L("Relationship")</label>
                <span class="help-block">     @L("Relationship")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Industry" ng-class="{'edited':vm.basicPerson.industry}" ng-model="vm.basicPerson.industry" maxlength="100" required />
                <label>@L("Industry")</label>
                <span class="help-block">     @L("Industry")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="ContractField" ng-class="{'edited':vm.basicPerson.contractField}" ng-model="vm.basicPerson.contractField" maxlength="50" required />
                <label>@L("ContractField")</label>
                <span class="help-block">     @L("ContractField")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="ResponsibilityField" ng-class="{'edited':vm.basicPerson.responsibilityField}" ng-model="vm.basicPerson.responsibilityField" maxlength="50" required />
                <label>@L("ResponsibilityField")</label>
                <span class="help-block">     @L("ResponsibilityField")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="HouseNumber" ng-class="{'edited':vm.basicPerson.houseNumber}" ng-model="vm.basicPerson.houseNumber" maxlength="50" required />
                <label>@L("HouseNumber")</label>
                <span class="help-block">     @L("HouseNumber")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Building" ng-class="{'edited':vm.basicPerson.building}" ng-model="vm.basicPerson.building" maxlength="50" />
                <label>@L("Building")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Bungalow" ng-class="{'edited':vm.basicPerson.bungalow}" ng-model="vm.basicPerson.bungalow" maxlength="50" />
                <label>@L("Bungalow")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="Politics" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.basicPerson.politics">
                    <option ng-repeat="x in vm.disPoliticsList" value="{{x.value}}" ng-selected="vm.basicPerson.politics==x.value">{{x.displayText}}</option>
                </select>
                <label>@L("Politics")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <div class="md-checkbox-list">
                    <div class="md-checkbox">
                        <input id="EditBasicPerson_IsMartyr" class="md-check" type="checkbox" name="IsMartyr" ng-model="vm.basicPerson.isMartyr">
                        <label for="EditBasicPerson_IsMartyr">
                            <span class="inc"></span>
                            <span class="check"></span>
                            <span class="box"></span>
                            @L("IsMartyr")
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <div class="md-checkbox-list">
                    <div class="md-checkbox">
                        <input id="EditBasicPerson_Isallowance" class="md-check" type="checkbox" name="Isallowance" ng-model="vm.basicPerson.isallowance">
                        <label for="EditBasicPerson_Isallowance">
                            <span class="inc"></span>
                            <span class="check"></span>
                            <span class="box"></span>
                            @L("Isallowance")
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <div class="md-checkbox-list">
                    <div class="md-checkbox">
                        <input id="EditBasicPerson_IsLonely" class="md-check" type="checkbox" name="IsLonely" ng-model="vm.basicPerson.isLonely">
                        <label for="EditBasicPerson_IsLonely">
                            <span class="inc"></span>
                            <span class="check"></span>
                            <span class="box"></span>
                            @L("IsLonely")
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <div class="md-checkbox-list">
                    <div class="md-checkbox">
                        <input id="EditBasicPerson_Iselderly" class="md-check" type="checkbox" name="Iselderly" ng-model="vm.basicPerson.iselderly">
                        <label for="EditBasicPerson_Iselderly">
                            <span class="inc"></span>
                            <span class="check"></span>
                            <span class="box"></span>
                            @L("Iselderly")
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <div class="md-checkbox-list">
                    <div class="md-checkbox">
                        <input id="EditBasicPerson_IsFiveGuarantees" class="md-check" type="checkbox" name="IsFiveGuarantees" ng-model="vm.basicPerson.isFiveGuarantees">
                        <label for="EditBasicPerson_IsFiveGuarantees">
                            <span class="inc"></span>
                            <span class="check"></span>
                            <span class="box"></span>
                            @L("IsFiveGuarantees")
                        </label>
                    </div>
                </div>
            </div>
            <div class="mrshen3"></div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="TownID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.basicPerson.townID" ng-change="vm.bindArea(vm.basicPerson.townID)" required>
                    <option ng-repeat="x in vm.townList" value="{{x.id}}" ng-selected="vm.basicPerson.townID==x.id">{{x.title}}</option>
                </select>
                <label>@L("TownID")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="AreaID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.basicPerson.areaID" ng-change="vm.bindVillage(vm.basicPerson.areaID)" required>
                    <option ng-repeat="x in vm.areaList" value="{{x.id}}" ng-selected="vm.basicPerson.areaID==x.id">{{x.title}}</option>
                </select>

                <label>@L("AreaID")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="VillageID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.basicPerson.villageID" required>
                    <option ng-repeat="x in vm.villageList" value="{{x.id}}" ng-selected="vm.basicPerson.villageID==x.id">{{x.title}}</option>
                </select>
                <label>@L("VillageID")</label>
            </div>


        </div>
        <div class="modal-footer">
            <button ng-disabled="vm.saving" type="button" class="btn btn-default" ng-click="vm.cancel()">@L("Cancel")</button>
            <button type="submit" button-busy="vm.saving" busy-text="@L("SavingWithThreeDot")" class="btn btn-primary blue" ng-click="vm.save()" ng-disabled="basicPersonCreateOrEditForm.$invalid"><i class="fa fa-save"></i> <span>@L("Save")</span></button>
        </div>
    </form>
</div>